package org.example.tinyurl.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: zk
 * @date: 2023/7/1 0:17
 * 测试 config
 */
@Controller
@RequestMapping("/config")
public class ConfigController {

    @NacosValue(value = "${useLocalCache:false}", autoRefreshed = true)
    private boolean useLocalCache;

    // http://localhost:8092/config/get
    @GetMapping("/get")
    @ResponseBody
    public boolean get() {
        return useLocalCache;
    }
}
